import { defineStore } from 'pinia'

export const userStore = defineStore('userStore', {
  state: () => ({
    // 用户信息
    userInfo: { token: 'Bear default' }
  }),
  persist: {
    storage: sessionStorage,
    paths: ['userInfo'],
    debug: false
  },
  actions: {
    setUserInfo(userInfo: any) {
      this.userInfo = userInfo
    },
    getToken() {
      return 'Bearer anything'
    }
  }
})

export default userStore